import java.util.Scanner;
import java.util.Random;
import java.util.Map;
import java.util.HashMap;

public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入三个选项，用逗号分隔：");
        String input = scanner.nextLine();
        String[] options = input.split(",");

        if (options.length == 3) {
            Map<String, Integer> selectionCounts = new HashMap<>();
            for (String option : options) {
                selectionCounts.put(option.trim(), 0);
            }

            for (int i = 0; i < 100; i++) {
                String selectedOption = selectRandomOption(options);
                selectionCounts.put(selectedOption.trim(), selectionCounts.get(selectedOption.trim()) + 1);
            }

            System.out.println("\n选择次数统计：");
            for (Map.Entry<String, Integer> entry : selectionCounts.entrySet()) {
                System.out.println(entry.getKey() + " 被选择了 " + entry.getValue() + " 次");
            }
        } else {
            System.out.println("请确保您输入了三个选项。");
        }
    }

    private static String selectRandomOption(String[] options) {
        Random random = new Random();
        int index = random.nextInt(options.length);
        return options[index].trim();
    }
}
